/**
 * Created with IntelliJ IDEA.
 * User: ratogan
 * Date: 10.04.13
 * Time: 22:49
 * To change this template use File | Settings | File Templates.
 */
public class Prosti_chisla {
    public static void main(String[] args){
        int chotchik_prostih_chisel=0;
        for (int ryad_chisel=2; ryad_chisel<=1000; ryad_chisel++)
           { int per_ost=1;
        for (int vtoroi_ryad_chisel=2; vtoroi_ryad_chisel<=1000; vtoroi_ryad_chisel++)
              {
               if  (ryad_chisel%vtoroi_ryad_chisel !=  0)
               {
                   per_ost++;                         //peremennaya_nakapluushaya_colichestvo_chisel_s_ostachai
               }
               if (per_ost == 999)
               {
                   System.out.println(ryad_chisel);
                  chotchik_prostih_chisel++;
               }

              }
           }
        System.out.println("kolichestvo prostih chisel = " + chotchik_prostih_chisel);
        }
    }

